package com.boxin.ims.modules.wechat.activity;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.boxin.ims.modules.wechat.entity.LotteryRecord;
import com.boxin.ims.modules.wechat.entity.Question;
import com.boxin.ims.modules.wechat.entity.Questionnaire;
import com.boxin.ims.modules.wechat.service.QuestionService;

@Service
public class FightingProcessor extends ActivityProcessor {
	
	@Autowired
	private QuestionService questionService;
	
	
	
	public void process() {
		Questionnaire questionnaire= (Questionnaire) param.get("questionnaire");
		Integer right =(Integer) param.get("right");
		List<Question> questionList = questionService.findByQuestionnaireId(questionnaire.getId());
		if(questionList.size()==right){
			createLotteryRecord();
			
			addScore();
			addMoney();
		}
	}



	@Override
	public LotteryRecord answerProcess() {
		// TODO Auto-generated method stub
		return null;
	}

}
